package com.curso.sesion9;

import java.io.File;
import java.io.IOException;


class OpsFile {
	public static void main(String [] args) {
		try {                      // warning: exceptions possible
			boolean newFile = false;
			File file = new File("E:\\Cesar\\CursoJava\\fileWritel.txt"); // it's only an object
			System.out.println(file.exists());  // look for a real file
			System.out.println(file.getAbsolutePath());
			System.out.println(file.getCanonicalPath());
			System.out.println(file.getName());
			System.out.println(file.getParent());
			System.out.println(file.getPath());
			
			File dir = new File("E:\\Cesar\\CursoJava\\"); // it's only an object
			System.out.println(dir.exists());  // look for a real file
			System.out.println(dir.getAbsolutePath());
			System.out.println(dir.getCanonicalPath());
			System.out.println(dir.getName());
			System.out.println(dir.getParent());
			System.out.println(dir.getPath());
			
			newFile = file.createNewFile();     // maybe create a file!
			System.out.println(newFile);        // already there?
			System.out.println(file.exists());  // look again }
		} catch(IOException e) { 
			e.printStackTrace();
		}
	}
}
